
import * as types  from './actionTypes.js'

import { fromJS } from 'immutable'

const defaultState = fromJS({
    usernum:10,
    ordernum:20,
    productnum:0
})

export default (state=defaultState,action)=>{
    if(types.type == types.SET_COUNT){
        return state.merge({
            usernum: action.payload.usernum,
            ordernum: action.payload.ordernum,
            productnum: action.payload.productnum,
        })
    }
    return state
}